#include<iostream>
#include<iomanip>
using namespace std;
int main()
{
	int n, k;
	cin >> n >> k;
	double ans1 = 0;
	double ans2 = 0;
	int count1 = 0;
	int count2 = 0;
	for (int i = 1; i < n + 1; i++) {
		if (i % k == 0) {
			count1++;
			ans1 += i;
		}
		else {
			count2++;
			ans2 += i;
		}
	}
	cout << fixed << setprecision(1) << ans1 * 1.0 / count1 << " " << ans2 * 1.0 / count2 << endl;
	return 0;
}